package com.dance.netty.netty.dubbo.consumer.client;

import com.dance.netty.netty.dubbo.common.api.HelloService;
import com.dance.netty.netty.dubbo.common.netty.NettyClient;

public class ClientBootstrap {

    private static final String PROTOCOL = "HelloService#printHello#";

    public static void main(String[] args) {

        // 创建一个消费者
        NettyClient nettyClient = new NettyClient();

        // 创建代理对象
        HelloService helloService = (HelloService) nettyClient.getBean(HelloService.class, PROTOCOL);

        // 通过代理对象调用服务提供者的方法(服务)
        String result = helloService.printHello("hi dubbo rpc");

        System.out.println("调用方法执行返回结果: " + result);
    }
}
